package front;


import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;



/**
 * Klasa rozruchowa serwera
 * @Author Daniel Schmidt
 * 
 */

/*
 * TODO:
 * - GUI
 * - IMPLEMENTACJA KLAS
 * 
 */

public class Main extends JFrame implements ActionListener {

	private static final long serialVersionUID = 2271471382153769075L;
//Komponenty okna
private JLabel JstanServera;
private JButton JuruchomServer;

public Main()  {
	
	super("Server");
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
	//setPreferredSize(new Dimension(100, 100));
	setSize(600, 600);
	setLocation(100,100);
	setLayout(new FlowLayout(FlowLayout.LEFT));
	init();
    add(JstanServera);
	add(JuruchomServer);
	
	setVisible(true); 
}
	
	public static void main(String[] args) {
		@SuppressWarnings("unused")
		Main main = new Main();
		
	}
	
private void init(){
	/// GUI  ///////////////////////////////
	JstanServera = new JLabel("Server jest wylaczony");
	JstanServera.setVerticalTextPosition(JLabel.BOTTOM);
	JstanServera.setHorizontalTextPosition(JLabel.CENTER);
	JstanServera.setAlignmentY(Component.BOTTOM_ALIGNMENT);
	JstanServera.setPreferredSize(new Dimension(200,30));
	
	JuruchomServer = new JButton("Uruchom Server");
	JuruchomServer.addActionListener(this);
	
  
	////////////////////////////////////////
	
}

@Override
public void actionPerformed(ActionEvent e) {
	Object source = e.getSource();
	 
	if(source == JuruchomServer){
		// METODA URUCHAMIAJACA
		JuruchomServer.setEnabled(false);
	}
	
}

}
